import * as mongoose from 'mongoose';
import db2 from '../lib/db/mongodb2';
//本地model
const excelExport2Schema: mongoose.Schema = new mongoose.Schema({
    userId:String,
    userName:String,
    date_:String,
    //客户拜访达成率
    visitCount_plan:Number,//计划拜访客户数量(一天)     
    actuall_visitCount:Number,//实际拜访数量
    consumerRate:String, //客户拜访达成率(一天) 
    //新客户
    newConsumerRate:String, //新客户拜访达成率
    newConsumerCount_plan:Number,//计划拜访新客户数量
    newConsumerCount_visit:Number,//实际拜访新客户数量
    //签到率
    checkInRate:String,//签到率
    actuall_checkIn:Number,//实际签到天数
    checkInTime:String,//签到时间
    //出差频率
    unBase_check:Number,//非工作地签到天数
    //门店拜访达标率
    reachStandardRate:String,//已拜访门店达标率
    reachStandardStoreCount:Number,//门店达标的数量
    visitedStoreCount:Number,//已经拜访的门店数量
    //门店拜访进度
    storeSchadule:String,//门店拜访进度
    totalCountStore:Number,//员工名下总的门店数量

    //==================新增==============================
    //现有客户
    nowConsumerRate:String,//现有客户拜访达成率
    visitCount_plan_nowConsumer:Number,//现有客户计划拜访数量
    nowConsumerCount_visit:Number,//实际拜访现有客户数量
    //==================新增==============================

    year: String,
    month: String,
    comment:Number

}, { collection: 'excelExport3'});
export interface Excel2 extends mongoose.Document {
  
    userId: string;
    userName: string;
    date_: string;
    visitCount_plan: number;
    actuall_visitCount: number;
    consumerRate: string;

    newConsumerRate:string;
    newConsumerCount_plan:number;//计划拜访新客户数量
    newConsumerCount_visit:number;//实际拜访新客户数量

    actuall_checkIn: number;//实际签到天数
    checkInRate: string;
    checkInTime: string;

    unBase_check:number;//非工作地签到天数==出差天数


    reachStandardRate:string;//已拜访门店达标率
    reachStandardStoreCount:number;//门店达标的数量

    visitedStoreCount:number;//已经拜访的门店数量

    storeSchadule:string;//门店拜访进度
    totalCountStore:number;//员工名下总的门店数量

    //==================新增==============================
    //现有客户
    nowConsumerRate:string;//现有客户拜访达成率
    visitCount_plan_nowConsumer:number;//现有客户计划拜访数量
    nowConsumerCount_visit:number;//实际拜访现有客户数量
    //==================新增==============================

    year: string;
    month: string;
    comment: number
}
let excelExportModel2 = db2.model<Excel2>('excelExport3', excelExport2Schema);
export default excelExportModel2;